<template>
	<view class="history-container">
		<uni-card class="font-text" :is-shadow="false" is-full>
			<text class="uni-h6">喝水是生命体通过口腔摄入水分的方式，人体每天通过口腔摄入的液体大约有2升。水主要在小肠吸收，进入人体后，水分主要用于补充细胞内液和细胞外液，参与人体各种生理活动，因此，喝水是维持生命体新陈代谢的重要一环。</text>
		</uni-card>
		<uni-list>
			<uni-list-item v-for="(item,index) in dataList" :title="item.createTime"
				:rightText="item.drinkType+'-'+item.capacity+item.unit"></uni-list-item>
		</uni-list>
		<view class="bottom-text-box">
			<text>请多喝点水，健康每一天！</text>
		</view>
	</view>
</template>

<script>
	import {
		getDrinkList,
	} from '@/api/record/drink.js'
	
	export default {
		data() {
			return {
				query: {
					pageSize: 200
				},
				dataList: [{
					capacity: 12,
					createTime: '2023-09-08 23:30:26',
					unit: 'ml'
				}],
			}
		},
		onLoad() {
			this.initList();
		},
		methods: {
			initList() {
				var that = this;
				getDrinkList(that.query).then(response => {
					that.dataList = response.rows;
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.font-text {
		text-indent: 2em;
	}
	.bottom-text-box {
		background-color: white;
		display: block;
		padding-top: 30px;
		height: 100px;
		text-align: center;
		font-size: 18px;
		color: #1890FF;
		font-weight: bolder;
	}
	.uni-list-item__extra-text {
	    width: 80px !important;
	}
</style>